package java46_oo1;

import java.util.Scanner;

public class SendGift {

	public static void main(String[] args) {
		// 商场派发礼品
		// 忽略了客户，商场类

		Scanner sc = new Scanner(System.in);
		while (true) {
			System.out.println("请输入卡号：");
			String cardNo = sc.next();
			System.out.println("请输入积分：");
			int jifen = sc.nextInt();
			if (jifen >= 15000) {
				Gift g2 = new Gift();
				g2.name = "苹果雪豹11系列台式机";
				g2.price = 14999;

				System.out.println(g2 + "送给 " + cardNo + "这个顾客了");
				g2.show();
			} else if (jifen >= 8000) {
				Gift g1 = new Gift();
				g1.name = "联想k3手机";
				g1.price = 199;
				System.out.println(g1);
				g1.show();
			} else {
				System.out.println("对不起，积分不足！");
			}
			System.out.println("还要兑奖不？");
			String ans = sc.next();
			if ("n".equals(ans))
				break;
		}
	}

}
